# -*- coding: utf-8 -*-
"""
Created on Fri Jun  2 11:56:19 2023

@author: zjy
"""

from ultralytics import YOLO
# Load a model
# model = YOLO("yolov8n.yaml")  # build a new model from scratch
model = YOLO("./model/best_traffic.pt")  # load a pretrained model (recommended for training)

# Use the model
# results = model.predict(source="./datasets/predict_traffic",save=True,show=True)  # predict on an image 摄像头按Q键退出视频才能打开
# 调用摄像头
results = model.predict(source=0,save=True,show=True)  # predict on an image 摄像头按Q键退出视频才能打开
